package namingService;


/**
 * Generated from IDL interface "AMI_ServerHandler".
 *
 * @author JacORB IDL compiler V 2.3.0, 17-Feb-2007
 * @version generated at 6-mar-2009 18.45.05
 */

public abstract class AMI_ServerHandlerPOA
	extends org.omg.PortableServer.Servant
	implements org.omg.CORBA.portable.InvokeHandler, namingService.AMI_ServerHandlerOperations
{
	static private final java.util.Hashtable m_opsHash = new java.util.Hashtable();
	static
	{
		m_opsHash.put ( "searchEntity_excep", new java.lang.Integer(0));
		m_opsHash.put ( "searchEntity", new java.lang.Integer(1));
		m_opsHash.put ( "insertEntity", new java.lang.Integer(2));
		m_opsHash.put ( "insertEntity_excep", new java.lang.Integer(3));
		m_opsHash.put ( "removeEntity", new java.lang.Integer(4));
		m_opsHash.put ( "removeEntity_excep", new java.lang.Integer(5));
	}
	private String[] ids = {"IDL:namingService/AMI_ServerHandler:1.0","IDL:omg.org/Messaging/ReplyHandler:1.0"};
	public namingService.AMI_ServerHandler _this()
	{
		return namingService.AMI_ServerHandlerHelper.narrow(_this_object());
	}
	public namingService.AMI_ServerHandler _this(org.omg.CORBA.ORB orb)
	{
		return namingService.AMI_ServerHandlerHelper.narrow(_this_object(orb));
	}
	public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream _input, org.omg.CORBA.portable.ResponseHandler handler)
		throws org.omg.CORBA.SystemException
	{
		org.omg.CORBA.portable.OutputStream _out = null;
		// do something
		// quick lookup of operation
		java.lang.Integer opsIndex = (java.lang.Integer)m_opsHash.get ( method );
		if ( null == opsIndex )
			throw new org.omg.CORBA.BAD_OPERATION(method + " not found");
		switch ( opsIndex.intValue() )
		{
			case 0: // searchEntity_excep
			{
				org.omg.Messaging.ExceptionHolder _arg0=(org.omg.Messaging.ExceptionHolder)((org.omg.CORBA_2_3.portable.InputStream)_input).read_value ("IDL:omg.org/Messaging/ExceptionHolder:1.0");
				_out = handler.createReply();
				searchEntity_excep(_arg0);
				break;
			}
			case 1: // searchEntity
			{
				_out = handler.createReply();
				searchEntity();
				break;
			}
			case 2: // insertEntity
			{
				_out = handler.createReply();
				insertEntity();
				break;
			}
			case 3: // insertEntity_excep
			{
				org.omg.Messaging.ExceptionHolder _arg0=(org.omg.Messaging.ExceptionHolder)((org.omg.CORBA_2_3.portable.InputStream)_input).read_value ("IDL:omg.org/Messaging/ExceptionHolder:1.0");
				_out = handler.createReply();
				insertEntity_excep(_arg0);
				break;
			}
			case 4: // removeEntity
			{
				_out = handler.createReply();
				removeEntity();
				break;
			}
			case 5: // removeEntity_excep
			{
				org.omg.Messaging.ExceptionHolder _arg0=(org.omg.Messaging.ExceptionHolder)((org.omg.CORBA_2_3.portable.InputStream)_input).read_value ("IDL:omg.org/Messaging/ExceptionHolder:1.0");
				_out = handler.createReply();
				removeEntity_excep(_arg0);
				break;
			}
		}
		return _out;
	}

	public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] obj_id)
	{
		return ids;
	}
}
